<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            width: 100%;
            height: 500px;
            background: skyblue;
        }
        span{
            color: #000;
            font-size: 12px;
        }
    </style>
</head>
<body>
    <div id="box"><span>看我72变</span></div>
    <script>
        var oBox=document.getElementById("box");
        var oSpan=document.getElementsByTagName("span")[0];
        var num=10;
        var t=0;
        var last=12;

        setInterval(function(){
            oSpan.style.color="rgb(" + parseInt(Math.random()*256) + "," + parseInt(Math.random()*256) + "," + parseInt(Math.random()*256) + ")";;
            
            oSpan.style.fontSize=num+last+"px";
            last+=num;
            t++;
            if(t%6==0){
                num*=-1;
            }

        },50);
    </script>
</body>
</html>